{
  LW Displce -- LightWave Vertex Displacements

  Displacement plug-ins deform objects by moving their points at each time step.

  Based on lwdisplce.h which is:
  Copyright 1999, NewTek, Inc.
}

{
  Copyright 2012, Jameel Halabi

  This unit is part of the BlaiseWave wrapper,
  which is licensed under the BSD 2-Clause license (see licenses/license.txt).
}

unit LW_Displce;

{$mode objfpc}{$H+}

interface

uses
  LW_Types, LW_Handler, LW_Render, LW_Meshes;

const
  LWDISPLACEMENT_HCLASS	  = 'DisplacementHandler'  ;
  LWDISPLACEMENT_ICLASS	  = 'DisplacementInterface';
  LWDISPLACEMENT_GCLASS	  = 'DisplacementGizmo'    ;
  LWDISPLACEMENT_VERSION  = 5                      ;

  LWDMF_WORLD		  = (1 shl 0);
  LWDMF_BEFOREBONES	  = (1 shl 1);
  LWDMF_AFTERMORPH        = (1 shl 2);
  LWDMF_NEED_NORMALS      = (1 shl 3);
  LWDMF_LAST              = (1 shl 4);

type

  PLWDisplacementAccess = ^TLWDisplacementAccess;
  TLWDisplacementAccess = record
    OPos    : TLWDVector ;
    Source  : TLWDVector ;
    Point   : TLWDVector ;
    Info    : PLWMeshInfo;
    WNorm   : TLWDVector ;
  end;

  PLWDisplacementHandler = ^TLWDisplacementHandler;
  TLWDisplacementHandler = record
    Inst     : PLWInstanceFuncs;
    Item     : PLWItemFuncs    ;
    Rend     : PLWRenderFuncs  ;

    Evaluate : procedure
               (      Instance : PLWInstance       ;
                const Access   : PLWDisplacementAccess) ;
    Flags    : function
               (      Instance : PLWInstance       ) : UInt32;
  end;

implementation

end.

